package com.tangly.codeing.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;
import java.util.Date;


/**
 * 文章
 *
 * @author tangbing
 * @date 2019-10-30
 */
@Document(indexName = "article", type = "doc", shards = 1, replicas = 0, refreshInterval = "-1")
public class Article implements Serializable {

    private static final long serialVersionUID = 42L;

    /**
     * 主键
     */
    @Id
    private long id;

    /**
     * uuid
     */
    @Field
    private String uuid;

    /**
     * 标题
     */
    @Field
    private String title;

    /**
     * 内容
     */
    @Field
    private String content;

    /**
     * 创建时间
     */
    @Field
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新时间
     */
    @Field
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 0：删除 1:正常
     */
    @Field
    private int status;

    /**
     * 创建人id
     */
    @Field
    private int creatorId;

    /**
     * 操作人用户id
     */
    @Field
    private int operatorId;


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(int creatorId) {
        this.creatorId = creatorId;
    }

    public int getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(int operatorId) {
        this.operatorId = operatorId;
    }

}